if(NOT TARGET @target_name@)
    if(CMAKE_CROSSCOMPILING)
        find_program(@find_program_variable@
            NAMES @executable_name@
            PATHS ENV PATH
            NO_DEFAULT_PATH
        )
    else()
        find_program(@find_program_variable@
            NAMES @executable_name@
            PATHS "${CMAKE_CURRENT_LIST_DIR}/@relative_path@bin/"
            NO_DEFAULT_PATH
        )
    endif()
    # TODO: In conan v2 with CMakeToolchain, can be replaced by:
    # find_program(@find_program_variable@ NAMES @executable_name@))
    # # Nice enough to handle grpc not in build_requires for native build
    # if(NOT @find_program_variable@ AND NOT CMAKE_CROSSCOMPILING)
    #     find_program(@find_program_variable@
    #         NAMES @executable_name@
    #         PATHS "${CMAKE_CURRENT_LIST_DIR}/@relative_path@bin/"
    #         NO_DEFAULT_PATH
    #     )
    # endif()

    if(@find_program_variable@)
        get_filename_component(@find_program_variable@ "${@find_program_variable@}" ABSOLUTE)
        add_executable(@target_name@ IMPORTED)
        set_property(TARGET @target_name@ PROPERTY IMPORTED_LOCATION ${@find_program_variable@})
    endif()
endif()
